﻿using PLCS.Application.Contracts.PLCConfigApp.Dtos;
using PLCS.Domain.PLCConfigs;
using System.ComponentModel;

namespace PLCS.Application.Contracts.PLCReadDataApp.Dtos;

public class PLCReadDataDto : EntityDto<Guid>
{
    /// <summary>
    /// 字段编号
    /// </summary>
    public string PLCReadDataNo { get; set; }

    public Guid PLCConfigId { get; set; }
    public string PLCConfigNo { get; set; }

    /// <summary>
    /// Desc:开始位
    /// Default:
    /// </summary>
    public int StartBit { get; set; }

    /// <summary>
    /// Desc:结束位
    /// Default:
    /// </summary>
    public int EndBit { get; set; }

    /// <summary>
    /// Desc:最新数据
    /// Default:
    /// </summary>
    public string? CurrentValue { get; set; }

    /// <summary>
    /// Desc:历史数据
    /// Default:
    /// </summary>
    public string? HistoricalValue { get; set; }

    /// <summary>
    /// Desc:读取数据类型
    /// Default:
    /// </summary>
    public Domain.Shared.Enums.DataType DataType { get; set; }

    public int Length { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    public string Remarks { get; set; }

    /// <summary>
    /// 是否监听
    /// </summary>
    ///
    public YesNo IsDependency { get; set; }

    /// <summary>
    /// 关联的字段名
    /// </summary>
    public string? CorrespondingField { get; set; }

    /// <summary>
    /// 关联的字段名
    /// </summary>
    public string? CorrespondingTable { get; set; }

    /// <summary>
    /// 关联的类型
    /// </summary>
    public string? CorrespondingType { get; set; }

    /// <summary>
    /// 关联的Where字段名
    /// </summary>
    public string? WhereField { get; set; }

    /// <summary>
    /// 关联的where字段值
    /// </summary>
    public string? WhereValue { get; set; }

    public DateTime CreationTime { get; set; }
    public DateTime? LastModificationTime { get; set; }
}